/**
 * Created by kenz on 2018/4/10.
 */
import { ADD_TODO, TOGGLE_TODO } from '../constants'

let nextID = 0
export const addTodo = text => {
  return {
    type: ADD_TODO,
    id: nextID++,
    text
  }
}

export const toggleTodo = id => {
  return {
    type: TOGGLE_TODO,
    id
  }
}